<template>
  <div>
    <h4>{{shopinfo.title}}</h4>
    <hr/>
    <div v-html="shopinfo.body" class="shopbody"></div>
  </div>
</template>
<script>
export default {
  data(){
    return{
      shopinfo:{}
    };
  },
   methods: {
    getinfo() {
      this.$http
        .get("http://192.168.0.104/linshi/api/get_shoparc.php?id="+ this.$route.params.id)
        .then(res => {
          if (res.status == 200) {
            this.shopinfo = res.body.shopinfo;
            console.log(res.body.shopinfo,111);
          }
        });
    },
  },
   created() {
    this.getinfo();
     
  },
    watch: {
    "shopinfo":function(){
        this.$emit("changTit",true,'商品详情-'+this.shopinfo.title);//更新父组件头部
    },
  }
}
</script>

<style lang="scss">
  .shopbody{
    img{width: 100%;vertical-align:bottom}
  }
</style>

